package casa.geometria;


public class Punto2D {
    private float x;
    private float y;

    public Punto2D() {
        super();
    }


    public Punto2D(float x, float y) {
        super();
        this.x = x;
        this.y = y;
    }


    public void setX(float x) {
        this.x = x;
    }

    public float getX() {
        return x;
    }

    public void setY(float y) {
        this.y = y;
    }

    public float getY() {
        return y;
    }
    
    public void moverX (float offsetX){
    x+=offsetX;
    }
   
    public void moverY (float offsetY){
    y+=offsetY;
    }
    
    public double distancia (float offsetX, float offsetY){
      return Math.sqrt( Math.pow(offsetX-x, 2) + Math.pow(offsetY-y, 2) );  
    }
    
      
}